﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace SocketServer
{
    class Logger
    {
        public Logger(MainWindow main, TextBox serverstatus, TextBox datalog)
        {
            this.srvstat = serverstatus;
            this.datalog = datalog;
            this.main = main;
        }

        public void ServerLog(String str)
        {
            //Console.Write(str);
            this.main.Dispatcher.Invoke((Action)(() =>
            {
                this.srvstat.AppendText(str);

            }));
        }

        public void Dump(String str)
        {
            //Console.Write(str);
            this.main.Dispatcher.Invoke((Action)(() =>
            {
                this.datalog.AppendText(str);

            }));
        }

        private TextBox srvstat;
        private TextBox datalog;
        private MainWindow main;
    }
}
